home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v10n06.arc
/
POKEWORD.ASM
< prev
next >
Wrap
Assembly Source File
|
1991-03-06
|
884b
|
32 lines
;----- POKEWORD.ASM
;
;Declare and use these routines as follows:
;
;DECLARE SUB PokeWord(BYVAL Segment%, BYVAL Address%, BYVAL Value%)
;DECLARE FUNCTION PeekWord%(BYVAL Segment%, BYVAL Address%)
;
;CALL PokeWord(Segment%, Address%, Value%)
;Word = PeekWord%(Segment%, Address%)
.Model Medium, Basic
.Code
PokeWord Proc, PokeAdr:DWord, Value:Word
Les BX,PokeAdr ;get the segmented address to poke to
Mov AX,Value ;and the value to place there
Mov ES:[BX],AX ;put 'er there
Ret ;return to BASIC
PokeWord Endp
PeekWord Proc, PeekAdr:DWord
Les BX,PeekAdr ;get the segmented address to peek from
Mov AX,ES:[BX] ;load AX with the function output
Ret ;return to BASIC
PeekWord Endp
End